<?php

class Application_Form_BizAdd extends Zend_Form
{

    public function init()
    {
        $this->setName('form_biz');
        
        $Title =  new Zend_Form_Element_Text('Title');
        $Title->setLabel('Название')
                ->setRequired(true)
                ->addValidator('NotEmpty')
                ->addFilter('StringTrim')
                ->addFilter('StripTags');
        
        $About = new Zend_Form_Element_Textarea('About');
        $About->setLabel('описание')
                ->setRequired(true)
                ->addValidator('NotEmpty')
                ->addFilter('StringTrim')
                ->addFilter('StripTags');
        
        $Town = new Zend_Form_Element_text('Town');
        $Town->setLabel('Город')
                ->setRequired(true)
                ->addValidator('NotEmpty')
                ->addFilter('StringTrim')
                ->addFilter('StripTags');
        
        $Address = new Zend_Form_Element_Text('Address');
        $Address->setLabel('Адресс')
                ->setRequired(true)
                ->addValidator('NotEmpty')
                ->addFilter('StringTrim')
                ->addFilter('StripTags');
        
        $Site = new Zend_Form_Element_Text('Site');
        $Site->setLabel('Сайт')
                ->addFilter('StringTrim')
                ->addFilter('StripTags');
        
        $types = new Application_Model_Type();
        //$data = 
        
        $Type = new Zend_Form_Element_Select('type_id');
        $Type->setLabel('Выбор Типа учереждения');
                foreach ($types->getAllTypes() as $c) {
                    $Type->addMultiOption($c->id,$c->type);
                }
        
        $Submit = new Zend_Form_Element_Submit('submit');
        $Submit->setLabel('Отправить');
        
        $this->addElements(array($Title,$About,$Town,$Address,$Site,$Type,$Submit));
    }


}

